package com.atguigu.test07;

import com.atguigu.test06.DepartmentDAO;
import com.atguigu.test06.DepartmentDAOImp1;
import com.atguigu.test06.bean.Department;
import org.junit.jupiter.api.Test;

import java.util.List;

/**
 * @author haoranlu
 * @project IntelliJ IDEA
 */
public class TestDepartmentDAOImp1 {
    private DepartmentDAO dd = new DepartmentDAOImp1();
    @Test
    public void test01(){
        Department d = new Department();
        d.setDepname("测试尚硅谷");
        d.setDeinfo("cccccc");
        dd.addDepartment(d);
    }
    @Test
    public void test02(){
        Department d = dd.getById(336);
        System.out.println(d);

        d.setDepname("发钱部");
        dd.updateDepartment(d);
    }
    @Test
    public void test03(){
        List<Department> all = dd.getAll();
        all.forEach(System.out::println);
    }
    @Test
    public void test04(){
        dd.deleteDepartment(334);
    }
}
